import { constantRouters, asyncAppRouter } from "@/router";

const permission = {
    state: {
        routers: constantRouters,
        addRouters: []
    },
    mutations: {
        SET_ROUTERS: (state, routers) => {
            state.addRouters = routers
            state.routers = constantRouters.concat(routers)
        }
    },
    actions: {
        GeneratorRouters({ commit }, data) {
            return new Promise((resolve, reject) => {
                commit('SET_ROUTERS', data)
                resolve()
            })
        }
    }
}

export default permission

